package picoevo.es.cmaes.cma;

/**
 * this class can be used to add the implementation of the
 * IObjectiveFunctionParallel interface to a class that implements the interface
 * IObjectiveFunction
 */
public abstract class AbstractObjectiveFunction implements IObjectiveFunction, IObjectiveFunctionParallel {
	abstract public double valueOf(double[] x);

	public double[] valueOf(double[][] pop) {
		double[] res = new double[pop.length];
		for (int i = 0; i < pop.length; ++i)
			res[i] = valueOf(pop[i]);
		return res;
	}
}
